<?php

/**
 * Venta form base class.
 *
 * @package    tvpv
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseVentaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'cliente_id'      => new sfWidgetFormPropelChoice(array('model' => 'Cliente', 'add_empty' => true)),
      'transaccionid'   => new sfWidgetFormInput(),
      'compradorid'     => new sfWidgetFormInput(),
      'compradoremail'  => new sfWidgetFormInput(),
      'compradorstatus' => new sfWidgetFormInput(),
      'pagostatus'      => new sfWidgetFormInput(),
      'subtotal'        => new sfWidgetFormInput(),
      'descuento'       => new sfWidgetFormInput(),
      'total'           => new sfWidgetFormInput(),
      'created_at'      => new sfWidgetFormDateTime(),
      'tipo'            => new sfWidgetFormInput(),
      'memo'            => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorPropelChoice(array('model' => 'Venta', 'column' => 'id', 'required' => false)),
      'cliente_id'      => new sfValidatorPropelChoice(array('model' => 'Cliente', 'column' => 'id', 'required' => false)),
      'transaccionid'   => new sfValidatorString(array('max_length' => 17)),
      'compradorid'     => new sfValidatorString(array('max_length' => 13)),
      'compradoremail'  => new sfValidatorString(array('max_length' => 50)),
      'compradorstatus' => new sfValidatorString(array('max_length' => 10)),
      'pagostatus'      => new sfValidatorString(array('max_length' => 15)),
      'subtotal'        => new sfValidatorNumber(),
      'descuento'       => new sfValidatorNumber(array('required' => false)),
      'total'           => new sfValidatorNumber(),
      'created_at'      => new sfValidatorDateTime(array('required' => false)),
      'tipo'            => new sfValidatorString(array('required' => false)),
      'memo'            => new sfValidatorString(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Venta', 'column' => array('transaccionid')))
    );

    $this->widgetSchema->setNameFormat('venta[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Venta';
  }


}
